# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.757.13.1 -> 1.757.13.2 # drivers/char/agp/agpgart_be.c 1.41.1.1 -> 1.41.1.2 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/10/29 maxk@qualcomm.com 1.758.1.1 # Merge bk://linux-bt.bkbits.net/marcel-2.4 # into qualcomm.com:/usr/src/bt-2.4 # -------------------------------------------- # 02/10/29 bjorn_helgaas@hp.com 1.757.13.2 # Factor out updating AGP device command registers. # -------------------------------------------- # diff -Nru a/drivers/char/agp/agpgart_be.c b/drivers/char/agp/agpgart_be.c --- a/drivers/char/agp/agpgart_be.c Wed Oct 8 09:08:00 2003 +++ b/drivers/char/agp/agpgart_be.c Wed Oct 8 09:08:00 2003 @@ -452,6 +452,19 @@ /* Generic Agp routines - Start */ +static void agp_device_command(u32 command) +{ + struct pci_dev *device; + + pci_for_each_dev(device) { + u8 agp = pci_find_capability(device, PCI_CAP_ID_AGP); + if (!agp) + continue; + + pci_write_config_dword(device, agp + 8, command); + } +} + static void agp_generic_agp_enable(u32 mode) { struct pci_dev *device = NULL; @@ -538,11 +551,7 @@ * command registers. */ - pci_for_each_dev(device) { - cap_ptr = pci_find_capability(device, PCI_CAP_ID_AGP); - if (cap_ptr != 0x00) - pci_write_config_dword(device, cap_ptr + 8, command); - } + agp_device_command(command); } static int agp_generic_create_gatt_table(void) @@ -3781,11 +3790,7 @@ * command registers. */ - pci_for_each_dev(device) { - cap_ptr = pci_find_capability(device, PCI_CAP_ID_AGP); - if (cap_ptr != 0x00) - pci_write_config_dword(device, cap_ptr + 8, command); - } + agp_device_command(command); } @@ -4585,11 +4590,7 @@ * command registers. */ - pci_for_each_dev(device) { - cap_ptr = pci_find_capability(device, PCI_CAP_ID_AGP); - if (cap_ptr != 0x00) - pci_write_config_dword(device, cap_ptr + 8, command); - } + agp_device_command(command); } static int __init serverworks_setup (struct pci_dev *pdev)